<?php include $this->admin_tpl('meta', 'admin');?>
<title>发送消息 - YzmCMS内容管理系统</title>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
		<ul>
			 <li><label><span class="c-red">*</span>收件人：</label><input type="text" class="input" name="send_to" value=""></li>
			 <li><label><span class="c-red">*</span>主题：</label><input type="text" class="input" name="subject" value=""></li>
			 <li><label><span class="c-red">*</span>内容：</label>
			 	<span class="span_input"><textarea class="textarea" name="content" style="width:75%"></textarea></span>
			 </li>
			 <li><input type="hidden" name="dosubmit" value="1">
			 <input class="dosubmit w_120 btn-primary radius" type="submit" value="提交">
			 <input class="btn w_120 btn-default radius" type="button" value="取消" onclick="yzmcms_close()">
			 </li>
		</ul>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer', 'admin');?>

<script type="text/javascript">
	function dosub(obj){
		 if(obj.send_to.value==''){
			 layer.msg('收件人不能为空！');
			 return false;
		 }
		 if(obj.subject.value==''){
			 layer.msg('主题不能为空！');
			 return false;
		 }
		 if(obj.content.value==''){
			 layer.msg('内容不能为空！');
			 return false;
		 }
        $.ajax({
            type: 'POST',
            url: '<?php echo U('add');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					parent.location.reload();       
			    }else{
					layer.msg(msg.message);
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>